<!doctype html>
<html lang="zh" class="no-js">
<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        *,html,body,div,ul,li{ border: 0px;padding: 0px;margin: 0px;font-family: "", Microsoft YaHei, Arial, Helvetica, sans-serif; }
        h1{ text-align: center;font-size: 20px;padding-top: 15px;}
        .content{ padding: 0px 10px;}
        .number{ height: 30px;line-height: 30px;text-align: right;margin: 10px 0px; position: relative;}
        .number div{ position: absolute;left: 0px;height: 30px;top:0px;line-height: 30px;text-align: left; }
        .number span{ display: inline-block;text-align: right;border-bottom: 1px solid #ccc;padding: 0px 20px; }
        table{ width: 100%; border-collapse: collapse;border: 1px solid #ccc; }
        table tr td{ border: 1px solid #ccc;padding: 0px 4px;padding: 6px 4px;font-size:15px;}
        table thead tr td{ padding: 8px 4px;font-weight: bold; }
    </style>
</head>
<body>
<div class="content">
    <?php $number=$head['header_number']?>
    <?php if(strstr($number,'RK')):?>
        <h1><?=$dealer_name?> / 入库单</h1>
    <?php else:?>
        <h1><?=$dealer_name?> / 出库单</h1>
    <?php endif;?>
    <div class="number">
        <div>
            时间：<?php echo $head['date_added']?>
        </div>
        编号：<span><?php echo $number?></span>
    </div>
<!--    <div>-->
<!--        供应商：--><?//=$dealer_name;?>
<!--    </div>-->
    </br>
    <table>
        <thead>
        <tr>
            <td class="center">材料类型</td>
            <td class="center">材料型号</td>
            <td class="center">单位</td>
            <td class="center">单价</td>
            <td class="center">数量</td>
            <td class="center">小结</td>
        </tr>
        </thead>
        <tbody>
        <?php $amount=0;?>
        <?php if ($items) { ?>
            <?php foreach ($items as $row) { ?>
                <tr>
                    <td class="center"><?php echo $row['name']; ?></td>
                    <td class="center"><?php echo $row['material_type_name']; ?></td>
                    <td class="center"><?php echo $row['sku']; ?></td>
                    <td class="right"><?php echo $row['price']; ?></td>
                    <td class="center"><?php echo $row['amount']; ?></td>
                    <td class="right"><?php echo $row['subtotal_price']; ?></td>
                    <?php $amount +=$row['subtotal_price'];?>
                </tr>
            <?php }} ?>
        <!--<tr>
            <td class="center"><b>操作人</b></td>
            <td colspan="5"><?php echo $head['operator']; ?></td>
        </tr>-->
        <tr>
            <td class="center"><b>备注信息</b></td>
            <td colspan="5"><?php echo $head['description']; ?></td>
        </tr>
        </tbody>
    </table>
    <div class="number">
        <label style="margin-right: 50px">操作人：<span>&nbsp;<?php echo $head['operator']; ?></span></label> 总金额：<span style="margin-right: 50px"><?php echo $amount?></span>
    </div>
</div>
</body>
</html>

<script type="text/javascript">
    window.onload=function(){
        window.print();
    }
</script>
